<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var age = prompt('请输入您的年龄');
        if (age <= 6) {
            alert('你现在是个小宝宝');
            console.log('在家开心玩吧');
        } else if (age >= 7 && age <= 10) {
            alert('可以去上幼儿园啦');
            console.log('可以去上幼儿园啦');
        }
        else if (age > 10 && age < 15) {
            alert('你是小学生了');
            console.log('你是小学生了');
        }
        else if (age >= 16 && age <= 20) {
            alert('高中生');
            console.log('高中生');
        }
        else if (age >= 22) {
            alert('打工上班族');
            console.log('上班族');
        }
    </script>
</body>

</html>